<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

	<h:head>
		<title>Livros</title>
	</h:head>
	
	<h:body>
		<h1>Novo Livro</h1>
		<h:messages/>
		<h:form>
			<h:outputLabel value="Nome: "/>
			<h:inputText value="#{livroMB.livro.nome}"/>
			
			<h:outputLabel value="Preco: : "/>
			<h:inputText value="#{livroMB.livro.preco}"/>
			
			<h:commandButton value="salvar" action="#{livroMB.adiciona}"></h:commandButton>
			
		</h:form>
		
		<h1>Lista de Livros</h1>
		<h:dataTable value="#{livroMB.livros}" var="livro">
			<h:column>
				<h:outputText value="#{livro.nome}"></h:outputText>
			</h:column>
			
			<h:column>
				<h:outputText value="#{livro.preco}"></h:outputText>
			</h:column>
			
		</h:dataTable>
	</h:body>
</html>